package com.foreknow.demo14;

public class Test  {
    public int add(int a ,int b)throws Exception{
        if (a<0||b<0){
            CustomException e = new CustomException();
            throw e;
        }
        return a+b;
    }

    public static void main(String[] args) {
        Test test = new Test();
        try {
            test.add(-1,-2);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
